package com.allen.admin.service.server.service.impl;

import java.time.LocalDate;

import com.allen.admin.service.common.domain.AdminUserOperLog;
import com.allen.admin.service.common.service.AdminUserOperLogService;
import com.allen.admin.service.server.manager.impl.AdminUserOperLogManager;
import com.xxx.config.ModelResult;
import com.xxx.page.DataPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("adminUserOperLogService")
public class AdminUserOperLogServiceImpl implements AdminUserOperLogService {
	
	@Autowired
	private AdminUserOperLogManager adminUserOperLogManager;

	@Override
	public ModelResult<AdminUserOperLog> create(AdminUserOperLog obj) {
		ModelResult<AdminUserOperLog> resultModelResult = new ModelResult<>();
		AdminUserOperLog user = adminUserOperLogManager.insert(obj);
		resultModelResult.withModel(user);
		return resultModelResult;
	}

	@Override
	public ModelResult<AdminUserOperLog> query(Long id) {
		ModelResult<AdminUserOperLog> resultModelResult = new ModelResult<>();
		AdminUserOperLog user = adminUserOperLogManager.selectById(id);
		resultModelResult.withModel(user);
		return resultModelResult;
	}
	
	@Override
	public ModelResult<DataPage<AdminUserOperLog>> queryPage(
			DataPage<AdminUserOperLog> dataPage,
			AdminUserOperLog qObj, 
			LocalDate beginDate, 
			LocalDate endDate) {
		ModelResult<DataPage<AdminUserOperLog>> resultModelResult = new ModelResult<>();
		dataPage = adminUserOperLogManager.queryPage(dataPage, qObj, beginDate, endDate);
		resultModelResult.withModel(dataPage);
		return resultModelResult;
	}

}
